#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2010 - BidiX@BidiX.info
#
#
'''
    http - 
    
    Description : 
 
     Usage :
     
'''
from google.appengine.api import urlfetch
from google.appengine.ext import webapp

from bidix.logger import log, Level 

    
class Redirect(webapp.RequestHandler):
    """
        redirect to 'url'
        log :
            - time
            - user
            - url
            - source
            - id
    """
    def get(self): 
        url = self.request.get('url')
        source = self.request.get('source')
        id = self.request.get('id')
        self.response.headers.add_header('Location' ,url)
        self.response.set_status(301)
        log(type="Redirect", level=Level.INFO, creator='bidix.http', url=url, source=source, id=id)

    
        
        

